﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 杨辉三角1._0
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n;
            string s;
            Console.WriteLine("Enter n:");
            s=Console.ReadLine();
            n = int.Parse(s);

            int[,] a = new int[n, n];
            
            for(int i = 0; i < n; i++)
            {
                for(int j = 0; j <= i; j++)
                {
                    if (j == 0 || i == j)
                        a[i, j] = 1;

                    else
                        a[i, j] = a[i - 1, j - 1] + a[i - 1, j];
                }
            }

            for(int i = 0; i < n; i++)
            {
                for (int k = 0; k < n - i; k++)
                    Console.Write("     ");
                for (int j = 0; j <= i; j++)
                    Console.Write("{0,10}", a[i, j].ToString());

                Console.Write("\n");
            }

            for (int i = 0; i < n; i++)
            {
                for (int k = 0; k < n - i; k++)
                    Console.Write("\t");
                for (int j = 0; j <= i; j++)
                    Console.Write("\t{0}\t", a[i, j].ToString());

                Console.Write("\n");
            }

            Console.ReadLine();
        }
    }
}
